package com.xj0927.myRuler;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: xj0927
 * @Description: 配置负载均衡算法
 * @Date Created in 2020-10-28 10:47
 * @Modified By:
 */
@Configuration
public class MyselfRule {

    @Bean
    public IRule myRule(){ //所有负载均衡算法的父接口：IRule
        return new RandomRule(); //定义为随机
    }
}
